//Created by Kyle "Fayt" Lowry
//EndGame.h

#pragma once

#include "SpriteInfo.h"
#include "Button.h"
#include "Text.h"
#include "Definitions.h"
#include "ENUM.h"

class Sprite;
class Input;

class EndGame
{
private:
	Sprite*		sprite;
	SpriteInfo	EndGameSprite[NUM_END_GAME_SPRITES];	//Sprite object used to load sprites for the end game (such as background image and button images)
	Input*		EndGameInput;							//Input for the end game screen such as mouse clicks and key presses
	Button		button[NUM_END_GAME_BUTTONS];			//Button array for all the buttons that will be displayed on the end game screen
	Button		selectedButton;							//Button object that represents a selected menu button (the mouse is over it)
	Text*		text[2];								//Text that will be displayed on the end game screen (mainly on the buttons)
	char		buffer[64];								//Buffer to write to and than send to the text object to write to the end game screen
	int			winner;									//The winning player variable (used to display the winner during the end game screen)

public:
	//////////////////////////////////////////////////////////////////////////
	// Name:		Init
	// Parameters:	Sprite*	a_sprite	- The one and only sprite object
	//									  that will be used for the end game
	//									  screen
	//				Input*	a_input		- Input object used for any input
	//				int		a_winner	- Represents the winning player which
	//									  is sent from the controller
	// Return:		void
	// Description: This function is run once when the game ends and will set
	//				up any objects that are needed for the end game screen.
	//////////////////////////////////////////////////////////////////////////
	void Init(Sprite*, Input*, int);

	//////////////////////////////////////////////////////////////////////////
	// Name:		Update
	// Parameters:	void
	// Return:		void
	// Description: This is run every frame. It is used to update the end
	//				screen variables as well as process input.
	//////////////////////////////////////////////////////////////////////////
	CONTROLLER_STATE Update();

	//////////////////////////////////////////////////////////////////////////
	// Name:		Render
	// Parameters:	void
	// Return:		void
	// Description: This is run every frame. It is used to draw any end
	//				game sprites or meshes if needed
	//////////////////////////////////////////////////////////////////////////
	void Render();

	//////////////////////////////////////////////////////////////////////////
	// Name:		Release
	// Parameters:	void
	// Return:		void
	// Description: This function is run when the end game screen is exited
	//				and will destroy any objects that are not needed for the
	//				other game states.
	//////////////////////////////////////////////////////////////////////////
	void Release();
};